package com.start.lambda;

public class LamdbaDemo {


    final static String salutation = "Hello! ";

    public static void main(String args[]) {

        /**
         * lamdba  语法
         */
        GreetingService greetService1 = message ->
                System.out.println(salutation + message);

        greetService1.sayMessage("Runoob");


        /**
         * 传统写法
         */
        GreetingService greetingService = new GreetingService() {
            @Override
            public void sayMessage(String message) {
                System.out.println(salutation + message);
            }
        };
        greetingService.sayMessage("sayHi-");

    }


    interface GreetingService {
        void sayMessage(String message);
    }

}
